<?
header( "Content-Type: text/html; Charset=utf-8" );
header( "pragma: no-cache" );
header( "Expires: Wed, 31 May 2000 14:59:58 GMT" );
header( "Cache-control: no-cache" );


foreach( $_GET as $Key => $Value ) {
	$_GET[$Key] = str_replace("\\\\", "\\", $Value );
	$_GET[$Key] = str_replace("\\'", "'", $_GET[$Key] );
	$_GET[$Key] = str_replace("\\\"", "\"", $_GET[$Key] );
}

//*****************************************************************************
//DB
//*****************************************************************************
$Server = 'PC-025';
$DbName = 'circle_manager';
$User = 'root';
$Password = 'password';

//**********************************************************
// 接続
//**********************************************************
$connect = @mysql_connect( $Server, $User, $Password );
if ( !$connect ) {
	$message = "接続に失敗しました";
}
else {
//**********************************************************
// DB選択
//**********************************************************
	mysql_select_db( $DbName, $connect );
	//mysql_set_charset("utf8", $connect); 
	mysql_query("set names 'utf8'", $connect);

//**********************************************************
//SQL文
//**********************************************************
	$query = "update user set username = '{$_POST['name']}', ";
	$query .= "email = '{$_POST['email']}', ";		 
	$query .= "birthdate = '{$_POST['birthdate']}' ";
	$query .= "where twitter_username = 'akahuku1953'";

print $query;
	$result = mysql_query($query, $connect);
	if ( !$result ) {
		$message = "更新エラーです";
	}


//**********************************************************	
// 接続解除
//**********************************************************
	mysql_close($connect);
}


?>